package com.swsc.solarverse.controller;

import com.swsc.solarverse.common.Constant;
import com.swsc.solarverse.model.RestResp;
import com.swsc.solarverse.service.schedule.ScheduleService;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Author CHENCL-X99
 * @Date 2025/5/13 8:53
 * @Version 1.0
 * @Description
 */
@org.springframework.web.bind.annotation.RestController
@org.springframework.web.bind.annotation.RequestMapping(value = Constant.API_VERSION_V1 + "/schedule")
public class ScheduleController {
    private final ScheduleService scheduleService;

    public ScheduleController(ScheduleService scheduleService) {
        this.scheduleService = scheduleService;
    }

    /**
     * 组串能效计算 取9-15点数据, 每分钟一条进行积分计算
     * @param organNo
     * @param dateTimes
     * @return
     */
    @org.springframework.web.bind.annotation.GetMapping(value = "/analysis/{organNo}/string/efficiency/record")
    public RestResp analysisStringEfficiencyRecord(@org.springframework.web.bind.annotation.PathVariable Integer organNo,
                                                   @org.springframework.web.bind.annotation.RequestParam String dateTimes) {
        scheduleService.analysisStringEfficiencyRecord(organNo, dateTimes);
        return RestResp.success();
    }

    /**
     * 组串IU分析
     * @param organNo
     * @param dateTimes
     * @return
     */
    @GetMapping(value = "/analysis/{organNo}/string/iu/record")
    public RestResp analysisStringIuRecord(@org.springframework.web.bind.annotation.PathVariable Integer organNo,
                                              @org.springframework.web.bind.annotation.RequestParam String dateTimes) {
        scheduleService.analysisStringIuRecord(organNo, dateTimes);
        return RestResp.success();
    }
}
